  ToolTip

Properties	Events

The ToolTip custom control allows you to add Microsoft style tool tips to your VB applications quickly and easily. A single control placed on the main form can handle tool tips for the complete application.

The ToolTip control tracks movement of the mouse over forms belonging to the application and if the mouse remains over any control for longer than 600 msec the GetToolTip event will be fired. You can specify the tool tip text for each control in the application by placing the appropriate VB code in the GetToolTip event handler. The tool tip window is removed as soon as the mouse leaves the control or a key is pressed. Once a tool tip has been displayed the mouse dwell period required to display a new tool tip is reduced to 200 msec to allow users to browse toolbars etc.

Properties are provided to control the foreground and background colours of the tool tip window as well as the font used to display the tool tip text. The window is sized and positioned automatically by the ToolTip control.

Application Notes

History

Registration


  Properties

The following properties are supported by the ToolTip control.

Standard Properties

BackColor	FontSize	Left
Enabled	FontStrikethru	Tag
FontBold	FontUnderline	Top
FontItalic	ForeColor
FontName	Index

Custom Properties

About


Standard Properties

For complete documentation on the standard properties supported by the TabFrame control please refer to the Visual Basic Language Reference. The comments below indicate where the TabFrame control differs from other controls in the use of these properties.

Enabled - If the ToolTip control is disabled then the GetToolTip event will never be fired and no tool tips will be displayed.

Font Properties and ForeColor/BackColor - These properties relate to the tool tip window displayed at runtime and have no visible effect at design time.


About Property

Description

Use this property to display the About dialog box which shows the ToolTip version number. Available only at design time.


  Events

The following events are supported by the ToolTip control.

GetToolTip


GetToolTip Event

Description

Occurs when the ToolTip control is about to display a tool tip window.

Syntax

Sub ctlname_GetToolTip([Index as Integer], FrmName as String, CtlName as String, ToolTip as String)

Remarks

The GetToolTip event uses these arguments:

Argument	Description

Index	Identifies the control if it is part of a control array.

FrmName	The name of the form containing the control for which the tool tip is about to be displayed.

CtlName	The name of the control for which the tool tip is about to be displayed. If the tool tip is to be displayed for the form then this argument will be an empty string.

ToolTip	The text to be displayed as a tool tip for the specified form or control. This value should be set in the GetToolTip event handler.

If the ToolTip argument is not changed before returning from the event handler then no tool tip window will be displayed.


  Application Notes

The following topics describe techniques which are commonly used with the ToolTip control.

  Using multiple ToolTip controls


Using Multiple ToolTip Controls

ToolTip controls are only active when the form on which they are placed is loaded into memory. If there is no single form in your application which is always loaded then you will need to use multiple ToolTip controls. You may also wish to use mulitple controls so that the tool tip management is kept local to each form - e.g. each form containing a ToolTip control to handle the controls on that form.

When the ToolTip control detects that a tool tip should be displayed (i.e. the mouse dwells over a control for more than the preset period) it will fire the GetToolTip event for each loaded ToolTip control until one of them provides some tool tip text. If none of the controls supplies any text then no tool tip window will be displayed.

The order in which the GetToolTip events are fired is indeterminate and so your tool tip management should be planned such that each form and control is handled by a single ToolTip control.


  Change History

Date	Description

15-Mar-1994	V1.0.0 - first version.


  Registration

The demonstration version of the ToolTip control is fully functional but may only be used in the development environment. Any attempt to use this version in conjunction with an EXE file will display a dialog box identifying it as a demonstration version and the control will fail to load.

If you find the ToolTip control useful then you can receive a full version by registering as follows :

1) In the SWREG forum on Compuserve. The fee is be $29.95 and the registration ID is 2275.

2) By sending a cheque or money order for £20 to :

GC Consulting Services Ltd
Fellsgarth House
Hognaston
Ashbourne
Derbyshire DE6 1PR
ENGLAND

In return for your registration you will receive the latest version of the ToolTip control and be eligible for product support (via the MSBASIC forum on Compuserve) and free product upgrades for a period of 12 months.

Any questions should be sent to Graham Cockell (Compuserve ID 100113,2774) via e-mail or the MSBASIC forum.